﻿package mortal.game.scene3D.util
{
    import com.gengine.core.frame.*;
    import flash.utils.*;
    import frEngine.manager.*;

    public class RoleResourceUtil extends Object
    {
        private static var dicRoleModel:Dictionary = new Dictionary();
        private static var dicRoleSkill:Dictionary = new Dictionary();
        private static const dicRoleSkillClearTime:int = 1.2e+006;

        public function RoleResourceUtil()
        {
            return;
        }// end function

        public static function changeRoleModel(param1:int, param2:Array) : void
        {
            var _loc_3:Array = null;
            if (dicRoleModel[param1])
            {
                _loc_3 = dicRoleModel[param1] as Array;
                Resource3dManager.instance.removeStaticResource.apply(null, _loc_3);
            }
            dicRoleModel[param1] = param2;
            Resource3dManager.instance.addStaticResource.apply(null, param2);
            return;
        }// end function

        public static function addRoleSkill(... args) : void
        {
            args = 0;
            args = 0;
            while (args < args.length)
            {
                
                if (args[args])
                {
                    dicRoleSkill[args[args]] = FrameManager.flashFrame.getTime();
                }
                args++;
            }
            Resource3dManager.instance.addStaticResource.apply(null, args);
            return;
        }// end function

        public static function checkRoleSkill() : void
        {
            var _loc_2:* = undefined;
            var _loc_1:* = FrameManager.flashFrame.getTime();
            for (_loc_2 in dicRoleSkill)
            {
                
                if (_loc_1 - dicRoleSkill[_loc_2] > dicRoleSkillClearTime)
                {
                    delete dicRoleSkill[_loc_2];
                    Resource3dManager.instance.removeStaticResource(_loc_2);
                }
            }
            return;
        }// end function

    }
}
